package com.zqh.myfmmall.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 商品评价 
 * </p>
 *
 * @author chrimer
 * @since 2022-01-20
 */
@Data
@ApiModel(value="ProductComments对象", description="商品评价 ")
public class ProductComments {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type = IdType.ASSIGN_UUID)
    private String commId;

    @ApiModelProperty(value = "商品id")
    private String productId;

    @ApiModelProperty(value = "购买的sku属性")
    private String skuProps;

    @ApiModelProperty(value = "订单项(商品快照)ID 可为空")
    private String orderItemId;

    @ApiModelProperty(value = "评论用户id 用户名须脱敏")
    private String userId;

    @ApiModelProperty(value = "是否匿名（1:是，0:否）")
    private Integer isAnonymous;

    @ApiModelProperty(value = "评价类型（1好评，0中评，-1差评）")
    private Integer commType;

    @ApiModelProperty(value = "评价等级 1：好评 2：中评 3：差评")
    private Integer commLevel;

    @ApiModelProperty(value = "评价内容")
    private String commContent;

    @ApiModelProperty(value = "评价晒图(JSON {img1:url1,img2:url2}  )")
    private String commImgs;

    @ApiModelProperty(value = "是否回复（0:未回复，1:已回复）")
    private Integer replyStatus;

    @ApiModelProperty(value = "回复内容")
    private String replyContent;

    @ApiModelProperty(value = "回复时间")
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime replyTime;

    @ApiModelProperty(value = "评价时间 可为空")
    @TableField(fill = FieldFill.INSERT)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "是否显示（1:是，0:否）")
    private Integer isShow;


}
